<?php

namespace app\forms;

use app\models\Config;

class ConfigForm extends Model
{

    public $module;
    public $data;

    public function rules()
    {
        return [

            ['module', 'string'],
            ['module', 'in', 'range' => array_values(Config::getSystemModule())],
            ['module', 'required'],

            [
                'module',
                'required',
                'on' => ['update', 'view']
            ],

        ];
    }

    public function scenarios()
    {
        return [
            'view' => ['module'],
            'update' => ['module', 'data'],
        ];
    }

}